/**
 * @projectName 高校就业网
 * @package com.kzj.CollegeEmploymentNetwork.service
 * @className com.kzj.CollegeEmploymentNetwork.service.EducationExperienceService
 * @copyright Copyright 2025 Thunisoft, Inc. All rights reserved.
 */
package com.kzj.CollegeEmploymentNetwork.service;

import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.thunisoft.artery.util.uuid.UUIDHelper;
import com.kzj.CollegeEmploymentNetwork.mapper.EducationExperienceMapper;
import com.kzj.CollegeEmploymentNetwork.model.EducationExperience;

/**
 * 教育经历表service接口实现类
 * 
 * @description 教育经历表service接口实现
 * @author kzj
 * @date 2025年01月20日 23:11:54
 * @version 1.0.0
 */
@Service
public class EducationExperienceService{

    /**
     * educationexperienceMapper
     */
    @Autowired
    private EducationExperienceMapper educationexperienceMapper;

    /**
     * EducationExperienceService
     * 
     * @description 插入一条教育经历表数据
     * @param educationexperience 教育经历表
     * @return 影响行数
     * @author kzj
     * @date 2025年01月20日 23:11:54
     * @version 1.0.0
     */
    public int insert(EducationExperience educationexperience) {
        if (StringUtils.isBlank(educationexperience.getBh())) {
            educationexperience.setBh(UUIDHelper.getUuid());
        }
        return educationexperienceMapper.insert(educationexperience);
    }

    /**
     * EducationExperienceService
     * 
     * @description 通过主键删除教育经历表数据
     * @param cbh 主键编号
     * @return 影响行数
     * @author kzj
     * @date 2025年01月20日 23:11:54
     * @version 1.0.0
     */
    public int delete(String cbh) {
        return educationexperienceMapper.deleteByPrimaryKey(cbh);
    }

    /**
     * EducationExperienceService
     * 
     * @description 通过主键修改EducationExperience数据
     * @param educationexperience 更新实体
     * @return 影响行数
     * @author kzj
     * @date 2025年01月20日 23:11:54
     * @version 1.0.0
     */
    public int update(EducationExperience educationexperience) {
        //updateByPrimaryKeySelective：为null的字段不会受影响
        //updateByPrimaryKey：字段为null时，会将数据库对应字段置空
        return educationexperienceMapper.updateByPrimaryKeySelective(educationexperience);
    }

    /**
     * EducationExperienceService
     * 
     * @description 通过条件查询多条数据
     * @param args 参数
     * @return List<EducationExperience>
     * @author kzj
     * @date 2025年01月20日 23:11:54
     * @version 1.0.0
     */
    public List<EducationExperience> select(EducationExperience args) {
        return educationexperienceMapper.select(args);
    }

    /**
     * EducationExperienceService
     * 
     * @description 通过主键查询教育经历表信息
     * @param cbh 主键编号
     * @return EducationExperience
     * @author kzj
     * @date 2025年01月20日 23:11:54
     * @version 1.0.0
     */
    public EducationExperience selectOne(String cbh) {
        return educationexperienceMapper.selectByPrimaryKey(cbh);
    }
}